package com.example.mall.service.impl;

import com.example.mall.mapper.SystemUserMapper;
import com.example.mall.mapper.UserInMapper;
import com.example.mall.pojo.SystemUser;
import com.example.mall.pojo.UserIn;
import com.example.mall.service.SystemUserService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.util.List;
import com.example.mall.service.SystemUserService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;


@Service
@AllArgsConstructor
public class SystemUserServiceImpl implements SystemUserService {

    SystemUserMapper systemUserMapper;
    UserInMapper userInMapper;


    @Override
    public SystemUser loginSystemUser(String username, String password) throws Exception {

        String username1 = userInMapper.getUsername(username);
        if(username1==null){
            return null;
        }else {
            SystemUser systemUser = systemUserMapper.login(username, password);
            if(systemUser==null){
                return null;
            }else {
                return systemUser;
            }
        }


    }
}
